Skip to content

feat: add scheduled workday accounting - #68

Merged
patrickschiller merged 1 commit into
mainfrom
codex/add-scheduled-workday-accounting
Dec 3, 2026
Merged

patrickschiller merged 1 commit into
mainfrom
codex/add-scheduled-workday-accounting

Conversation

@patrickschiller

Copy link
Copy Markdown
Owner

Summary

  • Add optional regular start and end times and a daily break policy to Team work schedules. Save the original punches and keep the existing manual clock-out and approval rules.
  • Calculate credited time once per local workday and show recorded time after the regular end in the working-time report and CSV, independently of the time-account balance.
  • Keep scheduled workday rules and terminal-managed breaks mutually exclusive per plan. Apply mode and plan changes on the next local day, retaining history and the existing calculation for overnight captures.

Verification

  • Nx Shared and Web suites, type checks, lint, and builds.
  • Full API E2E suite on PostgreSQL 16, including PWA, QR and PIN punches, effective dates, report and time-account reconciliation, and an overnight capture split at midnight.
  • Prisma migrations, API contract regeneration, and database/release tooling tests.

Signed-off-by: Patrick Schiller <p@trickschiller.de>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T23:06:36.973640Z 7d225d5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7d225d5934

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +168 to +172
if (groupIds.length) {
// A project switch at exactly midnight can split an overnight capture
// into otherwise same-day rows. Include siblings outside the visible day.
const groups = await tx.timeEntry.groupBy({
by: ['employeeId', 'captureGroupId'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve overnight detection for ungrouped Team splits

For a Team booking under a scheduled-workday plan, splitting an overnight entry exactly at midnight bypasses this protection: ordinary PWA bookings have no capture group, and TimeEntriesService.split only creates one for Solo entries (time-entries.service.ts:1216–1218). Neither resulting row crosses midnight, so both are recalculated as scheduled workdays instead of retaining the overnight calculation. With a 07:00–16:00 schedule and a 30-minute deduction at 30 credited minutes, a 23:50–00:20 booking changes from 30 credited minutes before splitting to 10 afterward. Preserve the original capture identity for these Team splits so project allocation cannot change credited working time.

Useful? React with 👍 / 👎.

@patrickschiller
patrickschiller merged commit 7f01f12 into main Dec 3, 2026
5 checks passed
@patrickschiller
patrickschiller deleted the codex/add-scheduled-workday-accounting branch December 3, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant